.class public Lorg/microemu/midp/media/audio/PCToneRunnablePoolFactory;
.super Ljava/lang/Object;
.source "PCToneRunnablePoolFactory.java"


# static fields
.field private static pcToneRunnableStack:Ljava/util/Stack;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 36
    new-instance v0, Ljava/util/Stack;

    invoke-direct {v0}, Ljava/util/Stack;-><init>()V

    sput-object v0, Lorg/microemu/midp/media/audio/PCToneRunnablePoolFactory;->pcToneRunnableStack:Ljava/util/Stack;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 39
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 41
    return-void
.end method

.method public static declared-synchronized getInstance(Ljavax/sound/sampled/SourceDataLine;Ljavax/sound/sampled/AudioInputStream;Ljavax/sound/sampled/AudioFormat;I)Lorg/microemu/midp/media/audio/PCToneRunnable;
    .locals 4
    .parameter "sourceDataLine"
    .parameter "audioInputStream"
    .parameter "audioFormat"
    .parameter "size"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 52
    const-class v2, Lorg/microemu/midp/media/audio/PCToneRunnablePoolFactory;

    monitor-enter v2

    :try_start_0
    sget-object v3, Lorg/microemu/midp/media/audio/PCToneRunnablePoolFactory;->pcToneRunnableStack:Ljava/util/Stack;

    invoke-virtual {v3}, Ljava/util/Stack;->pop()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lorg/microemu/midp/media/audio/PCToneRunnable;

    .line 55
    .local v1, pcToneRunnable:Lorg/microemu/midp/media/audio/PCToneRunnable;
    invoke-virtual {v1, p0}, Lorg/microemu/midp/media/audio/PCToneRunnable;->setSourceDataLine(Ljavax/sound/sampled/SourceDataLine;)V

    .line 56
    invoke-virtual {v1, p1}, Lorg/microemu/midp/media/audio/PCToneRunnable;->setAudioInputStream(Ljavax/sound/sampled/AudioInputStream;)V

    .line 57
    invoke-virtual {v1, p2}, Lorg/microemu/midp/media/audio/PCToneRunnable;->setAudioFormat(Ljavax/sound/sampled/AudioFormat;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/util/EmptyStackException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v3, v1

    .line 64
    .end local v1           #pcToneRunnable:Lorg/microemu/midp/media/audio/PCToneRunnable;
    :goto_0
    monitor-exit v2

    return-object v3

    .line 61
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 64
    .local v0, e:Ljava/util/EmptyStackException;
    :try_start_1
    new-instance v3, Lorg/microemu/midp/media/audio/PCToneRunnable;

    invoke-direct {v3, p0, p1, p2, p3}, Lorg/microemu/midp/media/audio/PCToneRunnable;-><init>(Ljavax/sound/sampled/SourceDataLine;Ljavax/sound/sampled/AudioInputStream;Ljavax/sound/sampled/AudioFormat;I)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 52
    .end local v0           #e:Ljava/util/EmptyStackException;
    :catchall_0
    move-exception v3

    monitor-exit v2

    throw v3
.end method

.method public static declared-synchronized push(Lorg/microemu/midp/media/audio/PCToneRunnable;)V
    .locals 2
    .parameter "pcToneRunnable"

    .prologue
    .line 74
    const-class v0, Lorg/microemu/midp/media/audio/PCToneRunnablePoolFactory;

    monitor-enter v0

    :try_start_0
    sget-object v1, Lorg/microemu/midp/media/audio/PCToneRunnablePoolFactory;->pcToneRunnableStack:Ljava/util/Stack;

    invoke-virtual {v1, p0}, Ljava/util/Stack;->push(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 75
    monitor-exit v0

    return-void

    .line 74
    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method
